<!-- Message Error -->
<?php if ($this->session->flashdata('f_frontpage')): ?>
    <div class="msg msg-ok boxwidth">
        <p><strong><?php echo $this->session->flashdata('f_frontpage'); ?></strong></p>
    </div>
<?php endif; ?>


<!-- Box -->
<div class="box">
    <!-- Box Head -->
    <div class="box-head">
        <h2>Edit Frontpage</h2>
    </div>
    <!-- End Box Head -->

    <form action="<?php echo base_url();?>admin/frontpage/edit_submit" method="post" enctype="multipart/form-data">

        <!-- Form -->
        <div class="form">
            <p>
                <label>Name <span>(Required Field)</span></label>
                <input type="text" class="field size1" name="name" value="<?php echo $frontpage->name;?>"/>
                <input type="hidden" class="field size1" name="id" value="<?php echo $frontpage->id;?>"/>
            </p>
            <p class="inline-field">
                <label>Type <span>(Required Field)</span></label>
                <select class="field size1" name="type" onchange="change_type()" id="type_field">
                    <option value="0" <?php echo ($frontpage->type==0)?'selected':'';?>>1 Image</option>
                    <option value="1" <?php echo ($frontpage->type==1)?'selected':'';?>>2 Image</option>
                    <option value="2" <?php echo ($frontpage->type==2)?'selected':'';?>>3 Image</option>
                </select>
            </p>
            <div id="image1" class="images">
            <p>
                <label>Photo 1</label>
                <img class="admin-designer-photo" src="<?php echo base_url();?>photo/frontpage/<?php echo $frontpage->img1;?>"/>
            </p>
            <p>
                <label>Change Photo 1<span>(Required Field)</span></label>
                <input type="file" class="field size1" name="img1"/>
            </p>
            <p>
                <label>Link 1<span>(Required Field)</span></label>
                <input type="text" class="field size1" name="link1" value="<?php echo $frontpage->link1;?>"/>
            </p>
            <p>
                <label>Description 1</label>
                <textarea class="field size1" rows="10" cols="30" name="text1"><?php echo $frontpage->text1;?></textarea>
            </p>
            </div>
            <div id="image2" class="images">
            <p>
                <label>Photo 2</label>
                <img class="admin-designer-photo" src="<?php echo base_url();?>photo/frontpage/<?php echo $frontpage->img2;?>"/>
            </p>
            <p>
                <label>Change Photo 2<span>(Required Field)</span></label>
                <input type="file" class="field size1" name="img2"/>
            </p>
            <p>
                <label>Link 2<span>(Required Field)</span></label>
                <input type="text" class="field size1" name="link2" value="<?php echo $frontpage->link2;?>"/>
            </p>
            <p>
                <label>Description 2</label>
                <textarea class="field size1" rows="10" cols="30" name="text2"><?php echo $frontpage->text2;?></textarea>
            </p>
            </div>
            <div id="image3" class="images">
            <p>
                <label>Photo 3</label>
                <img class="admin-designer-photo" src="<?php echo base_url();?>photo/frontpage/<?php echo $frontpage->img3;?>"/>
            </p>
            <p>
                <label>Change Photo 3<span>(Required Field)</span></label>
                <input type="file" class="field size1" name="img3"/>
            </p>
            <p>
                <label>Link 3<span>(Required Field)</span></label>
                <input type="text" class="field size1" name="link3" value="<?php echo $frontpage->link3;?>"/>
            </p>
            <p>
                <label>Description 3</label>
                <textarea class="field size1" rows="10" cols="30" name="text3"><?php echo $frontpage->text3;?></textarea>
            </p>
            </div>
        </div>
        <!-- End Form -->
        
        <!-- Form Buttons -->
        <div class="buttons">
            <input type="submit" class="button" value="submit" />
        </div>
        <!-- End Form Buttons -->
        
    </form>
</div>
<!-- End Box -->